/*
** my_power_rec.c for my_power_rec in /home/goupil_r//afs/local/Jour_05
** 
** Made by robin goupil
** Login   <goupil_r@epitech.net>
** 
** Started on  Fri Oct  5 10:11:47 2012 robin goupil
** Last update Tue Oct  9 12:36:36 2012 robin goupil
*/

int     my_power_rec(int nb, int power)
{
  int	sign;

  sign = 1;
  if (power == 0)
    return (1);
  if (nb < 0)
    {
      nb = nb * (-1);
      sign = (-1);
    }
  if (power > 1)
    {
      power = power - 1;
      nb = nb * my_power_rec(nb, power);
    }
  else
    return (nb * sign);
}
